{js:kindeditor}
<div class="headbar">
	<div class="position"><span>会员</span><span>></span><span>用户组管理</span><span>></span><span>{if:isset($group['group_id'])}修改{else:}添加{/if}用户组</span></div>
</div>
<div class="content_box">
	<div class="content form_content">
		<form action="{url:/member/group_save}" method="post">
			<input type="hidden" name="group_id" value="{$group['group_id']}" />
			<table class="form_table">
				<col width="150px" />
				<col />
				<tr>
					<th>用户组：</th><td><input class="normal" name="group_name" type="text" value="{$group['group_name']}" pattern="required" alt="名称不能为空" /><label>* 用户组名称</label></td>
				</tr>
				<tr>
					<th>折扣率：</th><td><input class="normal" name="discount" type="text" value="{$group['discount']}" pattern="float" alt="格式不正确（请输入数字，允许包含小数）" />%<label>折扣率，例如：如果输入90，表示该会员组可以以商品原价的90%购买（允许包含小数）。</label></td>
				</tr>
				<tr>
					<th>最小经验：</th><td><input class="small" name="minexp" onblur="check_exp();" type="text" value="{$group['minexp']}" pattern="int" alt="请填写一个整数值" /><label>进入此会员组的经验值下限</label></td>
				</tr>
				<tr>
					<th>最大经验：</th>
					<td>
						<input class="small" name="maxexp" onblur="check_exp();" type="text" value="{$group['maxexp']}" pattern="int" alt="请填写一个整数值" />
						<label>进入此会员组的经验值上限</label>
					</td>
				</tr>
				<tr>
					<td></td><td><button class="submit" type="submit"><span>确 定</span></button></td>
				</tr>
			</table>
		</form>
	</div>
</div>

<script type='text/javascript'>
	//检查经验输入
	function check_exp()
	{
		var minexp = parseInt($('[name="minexp"]').val());
		var maxexp = parseInt($('[name="maxexp"]').val());

		if(maxexp <= minexp)
		{
			alert('最大经验值必须比最小经验值大');
			$('[name="minexp"]').removeClass('valid-text');
			$('[name="maxexp"]').removeClass('valid-text');
			$('[name="minexp"]').addClass('invalid-text');
			$('[name="maxexp"]').addClass('invalid-text');
			return false;
		}
		else
		{
			$('[name="minexp"]').removeClass('invalid-text');
			$('[name="maxexp"]').removeClass('invalid-text');
		}
	}
</script>
